package de.lusiardi.webdav.headers;

import java.util.logging.Logger;

/**
 * http://www.webdav.org/specs/rfc4918.html#HEADER_Lock-Token
 *
 * @author shing19m
 */
public class LockTokenHeader implements Header {

    private static final Logger logger = Logger.getLogger(LockTokenHeader.class.getCanonicalName());

    public static final String KEY = "Lock-Token";

    private String value;

    public String getKey() {
        return KEY;
    }

    public void setValue(String val) {
        value = val;
        if (!checkValue()) {
            logger.warning(String.format("'%s' is an invalid value for Lock-Token header.", value));
        }
    }

    public String getValue() {
        return value;
    }

    /**
     * As defined in http://www.webdav.org/specs/rfc4918.html#HEADER_Lock-Token:
     * <pre>Lock-Token = "Lock-Token" ":" Coded-URL</pre>
     *
     * @return
     */
    public boolean checkValue() {
        return true;
    }
}
